package us.du.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import us.du.result.ResultData;
import us.du.service.AmzonProductCrawlService;

import java.util.Map;

/**
 * @author zhangcheng
 * @date 2019/11/17 17:14
 */
@Api(tags = "亚马逊商品信息")
@Slf4j
@RestController
@RequestMapping(value = "/amazonProduct")
public class AmzonProductController {

    @Autowired
    AmzonProductCrawlService amzonProductCrawlService;


    @ApiOperation(value = "通过ASIN获取商品信息")
    @GetMapping("/crawlProduct")
    public ResultData<Map<String, Object>> crawlProduct(@RequestParam String asin) {
        return new ResultData<>("200", "请求成功", amzonProductCrawlService.cralw(asin));
    }
}